package view;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

import model.MetaDeckModel;

@SuppressWarnings("serial")
public class MetaDeckFrame extends JFrame {
	final private MetaDeckModel model;
	final private GameComponent gameComp;
	final private ChatComponent chatComp;
	

	public MetaDeckFrame(MetaDeckModel tmodel) {
		ImageLoader.prefetchImages();
		this.model = tmodel;
		
		gameComp = new GameComponent(model.getGame());
		chatComp = new ChatComponent(model.getChat());
		
		JPanel sidePanel = new JPanel();
		sidePanel.setPreferredSize(new Dimension(250, 600));
		sidePanel.setLayout(new BoxLayout(sidePanel, BoxLayout.PAGE_AXIS));
		sidePanel.add(chatComp);
		
		JPanel content = new JPanel();
		content.add(gameComp);
		content.add(sidePanel);
		add(content);
		pack();
		this.setBackground(Color.BLACK);
		content.setBackground(Color.BLACK);
		this.setTitle("MetaDeck");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}

	public GameComponent getGame() {
		return gameComp;
	}
	public ChatComponent getChat() {
		return chatComp;
	}
}
